﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System.Windows;
using System.Windows.Controls;

namespace DragDropLibrary
{
    /// <summary>
    /// Strongly-typed drop event args, where T is the type of data being dropped
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class DropEventArgs<T> : RoutedEventArgs
    {
        /// <summary>
        /// The data being dropped
        /// </summary>
        public T Object { get; set; }

        /// <summary>
        /// The originating Items Control for the drag
        /// </summary>
        public ItemsControl DragSource { get; set; }

        /// <summary>
        /// The UI element the data is being dropped onto
        /// </summary>
        public UIElement DroppedOnto { get; set; }

        /// <summary>
        /// The point (relative to the UI Element Dropped Onto) where the data was dropped
        /// </summary>
        public Point DropPoint { get; set; }

        public DropEventArgs() { }

        /// <summary>
        /// Do not modify the signature of this constructor.  It is used by Drop.cs, method ctrl_Drop
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="dragSource"></param>
        /// <param name="droppedOnto"></param>
        /// <param name="dropPoint"></param>
        public DropEventArgs(T obj, ItemsControl dragSource, UIElement droppedOnto, Point dropPoint)
        {
            Object = obj;
            DragSource = dragSource;
            DroppedOnto = droppedOnto;
            DropPoint = dropPoint;
        }
    }
}
